<template>
  <div class="page">

    <!-- 导航 开始 -->
    <nav-bar title="医生团队"></nav-bar>
    <!-- 导航 end -->

    <!-- 列表区域 开始 -->
    <div class="list" v-if="doctorList && doctorList.length">
      <HospTeamDor v-for="(item,index) in doctorList" :key="index" :info="item" />
      <!-- <div class="doctor_cell" v-for="(item,index) in doctorList" :key="index">
        <div class="avatar">
          
          <li-image :src="item.logo" class="img" round v-if="item.logo"></li-image>
          <van-image :src="require('@/assets/images/avatar.png')" class="img" round lazy-load v-else />
          <img src="@/assets/images/rz.png" class="rz" alt="" v-if="item.hasCertified == 1" />
        </div>
        <div class="info">
          <div class="title">
            <span class="name">{{ item.name }}</span>
            <span class="sub">{{ item.personalTitle }}</span>
          </div>
          <div class="rate">
            <span class="num">从业经验{{item.workYears}}年</span>
          </div>
          <div class="tag_list">
            <span class="name">擅长：</span>
            <div class="tag" v-for="(citem,idx) in getProject(item.expertProject)" :key="`c_${idx}`">{{ citem }}</div>
          </div>
        </div>
      </div> -->
    </div>
    <div class="list" v-else>
        <no-data></no-data>
    </div>
    <!-- 列表区域 end -->

  </div>
</template>
<script>
import { GET_HOSPITAL_DOCTORS } from "@/http/interface";
import HospTeamDor from '@/components/doctor/doctor'
export default {
  components:{
    HospTeamDor
  },
  data() {
    return {
        doctorList:[]
    };
  },
  async asyncData({query,$axios,params}){
    let _params = {id:params.id}
    let res = await $axios.get(GET_HOSPITAL_DOCTORS,{params:_params})
    let doctorList = res.data || []
    return {
        doctorList
    }
  },
  methods:{
    // 获取擅长项目
    getProject(str){
      let arr = []
      if(!str){
        return []
      }
      arr = str.split(',')
      return arr;
    }
  }
};
</script>
<style lang="less" scoped>
@import "/assets/styles/hospital/doctor.less";
</style>